package top.frsf.autocodegen.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import top.frsf.autocodegen.entity.AutoFieldMap;
import top.frsf.autocodegen.mapper.AutoFieldMapMapper;
import top.frsf.autocodegen.service.IAutoFieldMapService;
import org.springframework.stereotype.Service;

import java.util.HashMap;

/**
 * 字段类型管理(AutoFieldMap)表服务实现类
 *
 * @author makejava
 * @since 2024-08-04 15:53:59
 */
@Service("autoFieldMapService")
public class AutoFieldMapServiceImpl extends ServiceImpl<AutoFieldMapMapper, AutoFieldMap> implements IAutoFieldMapService {

    @Override
    public HashMap<String, String> getFieldMap() {
        HashMap<String, String> map = new HashMap<>();
        this.list().forEach(item -> {
            map.put(item.getFieldType(), item.getCaseType());
        });
        return map;
    }
}

